// pages/components/tabbar/tabbar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    selected: {
      type: Number,
      value: 0
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    color: "#aaaaaa",
    selectedColor: "#19287b",
    list: [
      {
        pagePath: "/pages/index/index",
        iconPath: "http://lanling.365use.net/hguser/tabbar/footmenu01.png",
        selectedIconPath: "http://lanling.365use.net/hguser/tabbar/footmenu01on.png",
        text: "首页"
      },
      {
        pagePath: "/pages/beima/index",
        iconPath: "http://lanling.365use.net/hguser/tabbar/footmenu02.png",
        selectedIconPath: "http://lanling.365use.net/hguser/tabbar/footmenu02on.png",
        text: "贝妈盈"
      },
      {
        pagePath: "/pages/market/index",
        iconPath: "http://lanling.365use.net/hguser/tabbar/footmenu03.png",
        selectedIconPath: "http://lanling.365use.net/hguser/tabbar/footmenu03on.png",
        text: "商城"
      },
      {
        pagePath: "/pages/news/index",
        iconPath: "http://lanling.365use.net/hguser/tabbar/footmenu04.png",
        selectedIconPath: "http://lanling.365use.net/hguser/tabbar/footmenu04on.png",
        text: "孕娃"
      },
      {
        pagePath: "/pages/mine/index",
        iconPath: "http://lanling.365use.net/hguser/tabbar/footmenu05.png",
        selectedIconPath: "http://lanling.365use.net/hguser/tabbar/footmenu05on.png",
        text: "我的"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({ url })
      // this.setData({
      //   selected: data.index
      // })
    }
  }
})
